<!DOCTYPE html>
<html>
  
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
    <title>乐淘淘</title>
    <link href="./assets/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css">
    <link href="./assets/animate.css/animate.min.css" rel="stylesheet" type="text/css">
    <link href="./assets/fontawesome/css/all.min.css" rel="stylesheet" type="text/css">
    <link href="./assets/slick/slick.css" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;700&display=swap" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap" rel="stylesheet" type="text/css">
    <link href="./assets/css/theme.min.css" rel="stylesheet" type="text/css"></head>
  
  <body class="body">
	  <div id="app">
    <div class="page-loader cube-loader">
      <div class="loader-wrap">
        <div class="loader-1 loader-element"></div>
        <div class="loader-2 loader-element"></div>
        <div class="loader-4 loader-element"></div>
        <div class="loader-3 loader-element"></div>
      </div>
    </div>
<header class="header-colorfull header-horizontal header-over header-view-side">
      <div class="container">
        <nav class="navbar">
          <a class="navbar-brand" href="indextest.html">
            <span class="logo-element-line">
              <span class="logo-icon">
                <span class="svg-content svg-fill-theme" data-svg="./assets/images/svg/logo-part.svg"></span>
              </span>
              <span class="logo-text" style="font-weight:bold">乐淘淘线上购物管理系统</span></span>
          </a>
          <button class="navbar-toggler" type="button">
            <i class="fas fa-bars nav-show"></i>
            <i class="fas fa-times nav-hide"></i>
          </button>
          <div class="navbar-collapse">
            <div class="container">
              <ul class="navbar-nav" >
                <li class="nav-item  nav-hover-show-sub" style="cursor: pointer;">
                  <a class="nav-link" onclick="window.location.href='duibi1.html'" data-role="nav-toggler" style="font-weight:bold">账户管理
				 
				<li class="nav-item  nav-hover-show-sub" style="cursor: pointer;">
				  <a class="nav-link" onclick="window.location.href='productpage.html'" data-role="nav-toggler" style="font-weight:bold">进货管理
				 
	
                <li class="nav-item nav-item-arrow-down nav-hover-show-sub" style="cursor: pointer;">
                  <a class="nav-link"  data-role="nav-toggler" style="font-weight:bold">相关页面
                    <span class="nav-arrow">
                      <i class="fas fa-chevron-down"></i></span>
                  </a>
                  <ul class="collapse nav">
                    <li class="nav-item nav-item-arrow-down nav-hover-show-sub">
						
						
					<li class="nav-item nav-item-arrow-down nav-hover-show-sub">
					  <a class="nav-link" href="#" data-role="nav-toggler" style="font-weight:bold">关于我们
					    <span class="nav-arrow">
					      <i class="fas fa-chevron-down"></i></span>
					  </a>
					  <ul class="collapse nav">
					    <li class="nav-item">
					      <a class="nav-link" href="about-us-alt-master.html" style="font-weight:bold">"我们"的简介</a></li>
					  </ul>
					</li>
					
					<li class="nav-item nav-item-arrow-down nav-hover-show-sub">
					  <a class="nav-link" href="#" data-role="nav-toggler" style="font-weight:bold">盈销情况
					    <span class="nav-arrow">
					      <i class="fas fa-chevron-down"></i></span>
					  </a>
					  <ul class="collapse nav">
					    <li class="nav-item">
					      <a class="nav-link" href="yingxiao-master.html" style="font-weight:bold">盈销记录</a></li>
					  </ul>
					</li>
					
					

                </ul>
				
                </li>
                <li class="nav-item">
                  <a class="nav-link" href="contact-us-master.html" style="font-weight:bold">联系我们</a></li>
              </ul>
              <div class="navbar-extra">
                <ul class="actions-nav">
                  <li class="nav-item">
                    <a class="nav-link" href="#">
                      <i class="fas fa-search"></i>
                      <span class="navbar-mobile">&nbsp;&nbsp;淘一下</span></a>
                  </li>
                  <li class="nav-item nav-item-arrow-down nav-hover-show-sub">
                    <a class="nav-link" href="" style="font-weight:bold;font-size: 1rem;">待&nbsp;开&nbsp;发
                      <span class="nav-arrow">
                        <i class="fas fa-chevron-down"></i></span>
                    </a>
                    <ul class="collapse nav">
                      <li class="nav-item">
                        <a class="nav-link" href="" style="font-weight:bold">待&nbsp;开&nbsp;发</a></li>
                      <li class="nav-item">
                        <a class="nav-link" href="" style="font-weight:bold">待&nbsp;开&nbsp;发</a></li>
                    </ul>
                  </li>
                  <li class="nav-item nav-item-arrow-down nav-hover-show-sub">
                    <a class="nav-link" href="#" data-role="nav-toggler"  style="font-weight:bold;font-size: 1rem;">水果
                      <span class="nav-arrow">
                        <i class="fas fa-chevron-down"></i></span>
                    </a>
                    <ul class="collapse nav">
                      <li class="nav-item">
                        <a class="nav-link" href="#">水&nbsp;&nbsp;果</a></li>
                      <li class="nav-item">
                        <a class="nav-link" href="#">水 果 蔬 菜</a></li>
                      <li class="nav-item">
                        <a class="nav-link" href="#">蔬 菜</a></li>
                    </ul>
                  </li>
                  <li class="nav-item">
                    <a class="nav-link" href="login.html"  style="font-weight:bold;font-size: 1rem;">
                      <i class="fas fa-user"></i>&nbsp;&nbsp;退 出</a>
                  </li>
                  <li class="nav-item">
                    <a class="nav-link">
                      <i class="fas fa-shopping-bag"></i>
                      <span class="navbar-mobile">&nbsp;&nbsp;Cart</span>
                      <span class="cart-quantity">
                        <span class="badge badge-pill badge-cart">3</span></span>
                    </a>
                  </li>
                </ul>
                <div class="navbar-info">
                  <div class="navbar-info-title">We are the student of</div>
                  <div class="navbar-info-value">C W N U</div></div>
              </div>
            </div>
          </div>
        </nav>
      </div>
    </header>
   </header>
    <section class="after-head top-block-page with-back white-curve-after section-white-text">
      <div class="overflow-back bg-theme"></div>
      <div class="content-offs-stick my-5 container">
        <div class="section-solid with-back">
          <div class="full-block">
            <div class="section-back-text">Shop</div>
            <img class="d-none d-lg-block z-index-3" src="./assets/images/content/x/mandarin.png" alt="" data-size="280px" data-at="10%;bottom 35%">
            <img class="d-none d-lg-block z-index-3" src="./assets/images/content/x/kiwi-blur.png" alt="" data-size="137px" data-at="right 5%;35%">
            <img class="d-none d-lg-block z-index-3" src="./assets/images/content/x/shpinat-2.png" alt="" data-size="50px" data-at="65%;0%;-25deg"></div>
          <div class="z-index-4 position-relative text-center">
            <h1 class="section-title">进货&补源</h1>
          </div>
        </div>
      </div>
    </section>
    <div class="container">
      <div class="sidebar-container">
        <div class="content">
          <section class="section">
			  
            <div  class="grid row" >
				
			  
              <div v-for="item in commodityArray" class="col-12 col-lg-6 d-flex" >
                <article class="entity-block entity-hover-shadow">
                  <a class="entity-preview-show-up entity-preview" href="shop-product-sidebar-right.html">
                    <span class="embed-responsive embed-responsive-4by3">
                      <img class="embed-responsive-item" v-bind:src="'./assets/images/content/720x540/'+item.productImage" alt=""></span>
                    <span class="with-back entity-preview-content">
                      <span class="overflow-back bg-body-back opacity-70"></span>
                      <span class="m-auto h1 text-theme text-center">
                        <i class="fas fa-shopping-cart"></i>
                      </span>
                    </span>
                  </a>
                  <div class="fill-color-line" data-role="fill-line">
                    <div class="opacity-30 fill-line-segment bg-theme" data-role="fill-line-segment" data-min-width="10" data-preffered-width="50" data-max-width="80"></div>
                    <div class="opacity-60 fill-line-segment bg-theme" data-role="fill-line-segment" data-min-width="10" data-preffered-width="50" data-max-width="80"></div>
                    <div class="fill-line-segment bg-theme" data-role="fill-line-segment" data-min-width="10" data-preffered-width="50" data-max-width="80"></div>
                  </div>
                  <div class="entity-content">
                    <h4 class="entity-title">
                      <a class="content-link" href="shop-product-sidebar-right.html">{{item.productName}}</a></h4>
                    <p class="entity-text">{{item.productMerchant}}</p>
                    <div class="entity-bottom-line">
                      <div class="entity-price">
                        <span class="currency">¥</span>{{item.productPrice}}
                        <span class="price-unit">/ kg&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
						<span class="currency">库存:{{item.productAmount}}</span>{{item.productPrice}}
						</div>
                      <div class="entity-action-btns">
                        <a class="btn-sm btn btn-theme" href="#">采购</a></div>
                    </div>
                  </div>
                </article>
              </div>
			  
            </div>
           <div class="section-footer">
              <div class="paginator">
                <a class="paginator-nav" href="#">
                  <i class="fas fa-arrow-left"></i>
                </a>
                <a class="paginator-item" href="#" >1</a>
                <span class="active paginator-item">2</span>
                <a class="paginator-item" href="#">3</a>
                <span class="paginator-item">...</span>
                <a class="paginator-item" href="#">10</a>
                <a class="paginator-nav" href="#">
                  <i class="fas fa-arrow-right"></i>
                </a>
              </div>
            </div>
          </section> 
        </div>

      </div>
    </div>
	</div>
    <div class="scroll-top">
      <i class="fas fa-long-arrow-alt-up"></i>
    </div>
    <script src="./assets/jquery/jquery-3.3.1.min.js"></script>
    <script src="./assets/bootstrap/js/bootstrap.min.js"></script>
    <script src="./assets/shuffle/shuffle.min.js"></script>
    <script src="./assets/waypoints/jquery.waypoints.min.js"></script>
    <script src="./assets/slick/slick.min.js"></script>
    <script src="./assets/js-cookie/js.cookie.js" type="text/javascript"></script>
    <script src="./assets/js/gmap/silver.js"></script>
    <script src="./assets/js/script.js"></script>
    <script async defer="defer" src="https://ditu.google.cn/maps/api/js?key=AIzaSyBDBAbNXaCDOzujLCykXUvTylfbL1wUcaM&callback=initMap"></script>
  </body>
  <script src="./assets/js/vue.js"></script>
  <script src="./assets/js/axios.min.js"></script>
  <script src="./assets/js/const.js"></script>
  <script>
  	var config={
  		"el":"#app",
  		"data":{
			"commodityArray":[],
			"commodity_name":"",
			"commodity_price":"",
			"amount":"",
			"price":"",
			"cost":"",
  		},
  		"methods":{
			selectAll:function(){
				//http://localhost:9092/commodity/selectAll
				var url = baseUrl+"/product/selectAll";
				// console.log(url);
				axios.get(url)
				.then(function(response){
					this.vue.commodityArray = response.data.data;
					console.log(this.vue.commodityArray);
				})
				.catch();
				
			},
			insertCart:function(){
				window.alert("添加成功");
				console.log("13236547655");
			},
  			"insert":function(){
  				var serverUrl=baseUrl+"/orderlist/insert?amount=1&commodityId=1&commodityName=%E7%8C%95%E7%8C%B4%E6%A1%83"
  				+"?categoryId="+this.categoryId
  				+"&image="+this.image
  				+"&itemDesc="+this.itemDesc
  				+"&name="+this.name
  				+"&price="+this.price;
  				console.log(serverUrl);
  				axios.get(serverUrl)
  				.then(function(response){
  					var serverResult=response.data;
  					var code=serverResult.code;
  					if(code==0){
  						window.alert("添加成功")
  						//更新界面
  						//在then中调用函数，要加this.vue
  						this.vue.selectAllItem();
  					}else{
  						window.alert("添加失败")
  					}
  				})
  				.catch();
  			}
  		},
  		"mounted":function(){
  			// this.selectAllItem();
			this.selectAll();
  		}
  	}
  	var vue=new Vue(config);
  </script>
</html>